<template>
  <div class="bg-white page-content content">
    <q-tabs
      v-model="tab"
      narrow-indicator
      inline-label
      dense
      align="left"
      indicator-color="primary"
      active-color="primary"
      class="tab-label"
    >
      <q-tab v-for="(item, index) in taskTypeList" :key="index" :name="item.value" :label="item.label" :disable="item.disable"/>
    </q-tabs>
    <q-separator class="full-width" />
    <Task :taskType="tab" ref="task"/>
  </div>
</template>

<script>
import Task from './components/task'
import { taskTypeList } from './components/constant'
export default {
  name: 'task-manage',
  components: {
    Task
  },
  data () {
    return {
      taskTypeList: taskTypeList,
      tab: '1'
    }
  },
  beforeRouteEnter (to, from, next) {
    next(vm => {
      vm.init()
    })
  },
  methods: {
    init () {
      this.$refs.task.getTableData()
    }
  }
}
</script>

<style scoped lang="scss">

</style>
